<extend name="Public:base"/>

<block name="main">

<div id="yzh-content" class="col-xs-12">

    <div class="main-title">
        <h2>管理员列表</h2>
    </div>

    <div class="table-actions">
        <a class="btn btn-sm btn-primary" href="{:U('User/add')}"> 新增</a>
        <input type="submit" class="btn btn-sm btn-primary" name="dosubmit" value="删除" />
    </div>

    <form name="myform" action="{:U('user/deleteall')}" method="post">
        <table class="table table-hover table-striped">
            <thead>
                <tr>
                    <th style="width:20px;"><input type="checkbox" id="check_box" onclick="selectall('ids[]');" /></th>
                    <th>用户名</th>
                    <th>邮箱</th>
                    <th class="env-class">所属角色</th>
                    <th>最后登录时间</th>
                    <th>状态</th>
                    <th>操作管理</th>
                </tr>
            </thead>

            <tbody>
            <volist name="list" id="vo" key="k">
                <tr>
                    <td><input class="inputcheckbox " name="ids[]" value="{$vo['id']}" type="checkbox" ></td>
                    <td>{$vo.username}</td>
                    <td>{$vo.email}</td>
                    <td class="env-class">{$role[$vo['role']]}</td>
                    <td>{$vo['last_login_time']|date="Y-m-d H:m:s",###}</td>
                    <td><eq name="vo.status" value="1"><font color="red">√</font><else/><font color="blue">×</font></eq>
                    </td>
                    <td>
                        <a class="btn btn-xs btn-primary" href="{:U('User/edit','id='.$vo['id'])}">编辑</a>

                        <if condition="$vo.id == 1">
                        <a class="btn btn-xs btn-danger" disabled href="javascript:;">删除</a>
                        <else />
                        <a class="btn btn-xs btn-danger" href="javascript:confirm_delete('{:U('User/delete',array('id'=>$vo['id']))}')">删除</a>
                        </if>
                    </td>
                </tr>
            </volist>

            </tbody>
        </table>

    </form>

    <div id="pages">{$page}</div>
</div>

</block>